module.exports = {
  head: {
    title: 'Demo',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: 'Nuxt.js project' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '~/static/favicon.ico' },
      { rel: 'stylesheet', href: 'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.css' }
    ]
  },
  css: [
    'ant-design-vue/dist/antd.min.css'
  ],
  plugins: [
    '~/plugins/axios',
    {src: '~/plugins/antd', ssr: false}
  ],
  modules: [
    '@nuxtjs/axios'
  ],
  axios: {
    // retry: { retries: 3 }
    baseURL: 'http://127.0.0.1:8081'
  },
  build: {
    vendor: ['axios', 'js-cookie', 'ant-design-vue'],

    // Run ESLint on save
    extend (config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  },
  render: {
    bundleRenderer: {
      shouldPreload: (file, type) => {
        return ['script', 'style', 'font'].includes(type)
      }
    }
  },
  // loading: '~/components/loading.vue'
};
